package util;

import edu.wpi.first.wpilibj.AnalogChannel;

import edu.wpi.first.wpilibj.PIDSource;
/*
 *
 * @author TJ
 */
public class ScaledAnalogSource implements PIDSource {
    public AnalogChannel channel;
    private double scale;
    private double add;

    public ScaledAnalogSource(AnalogChannel channel, double scale, double add) {
        this.channel = channel;
        this.scale = scale;
        this.add = add;
    }

    public double pidGet() {
       double x =channel.getAverageVoltage();
        return 32.601 * x*x*x*x*x*x - 497.48*x*x*x*x*x + 3137*x*x*x*x - 10461*x*x*x + 19456*x*x - 19149*x + 7815.5;

    }

}
